import request from "../http";
import requestAll from "../httpAll";
let hostqtlogin = '/loginapi' //测试环境

// 登录页

// 密码登录
export function loginByPw(data) {
  return request({
    url: "/company/login",
    method: "POST",
    data
  });
}

// 短信登录 /company/userPhoneLogin
export function loginByText(data) {
  return request({
    url: "/company/userPhoneLogin",
    method: "POST",
    data
  });
}

// qt登录接口 
export function getLoginQT(data) {
  return requestAll({
    url: `${hostqtlogin}/public/user/auth/login?tenantId=1&appId=YH-SMART-CITY`,
    method: "POST",
    data
  });
}

// 找回密码页面
// 认证企业信息
export function getInfoAuth(params) {
  return request({
    url: `/company/profile/checkUserName`,
    method: "GET",
    params
  });
}

// 注册用户
export function createUser(data) {
  return request({
    url: `/company/profile/setUpNewPassword`,
    method: "POST",
    data
  });
}

// 验证用户名
export function checkUserName(params) {
  return request({
    url: `/company/profile/checkUserName`,
    method: "GET",
    params
  });
}

// 企业注册页面
// 获取选项信息 
export function getFormOptions(data) {
  return request({
    url: `/company/initSelectInfo`,
    method: "POST",
    data
  });
}

// 认证企业信息
export function getCompanyAuthentication(data) {
  return request({
    url: `/company/companyAuthentication`,
    method: "POST",
    data
  });
}

// 创建账号表单页面
// 创建用户 /company/artificialRegister /company/register
export function artificialRegister(data) {
  return request({
    url: `/company/artificialRegister`,
    method: "POST",
    data
  });
}

export function register(data) {
  return request({
    url: `/company/register`,
    method: "POST",
    data
  });
}

// 人工认证，经办人信息比对


// 人工认证，法人单位信息比对
// 获取下一步信息
export function getNextStep(params) {
  return request({
    url: `/company/profile/getNextStep`,
    method: "GET",
    params
  });
}

// 人工认证，信息确认